<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class M_Logon extends CI_Model {
    
    function __construct() {
        parent::__construct();   
    }
    
    public function getUser($user, $pass){
        $sql='select * from user where NAMA= ? and PASSWORD= ?';
        $query = $this->db->query($sql,array($user,strtoupper(md5($pass))));
        foreach ($query->result() as $row) {           
           $this->session->set_userdata("user_name",$row->user_name);
           $this->session->set_userdata("user_name",$row->user_name);
        }
        return $query;
    }
    
}
